// //商品接口模块
// //引入工具函数
import request from '@/until/request'

//添加分类
export const addCateReq = data => {
  return request({
    method: 'post',
    url: '/goods/addcate',
    data,
  })
}

//获取分类列表
export const getCateListReq = params => {
  return request({
    method: 'get',
    url: '/goods/catelist',
    params,
  })
}

//删除分类
export const delCateReq = params => {
  return request({
    method: 'get',
    url: '/goods/delcate',
    params,
  })
}

//修改分类
export const editCateReq = data => {
  return request({
    method: 'post',
    url: '/goods/editcate',
    data,
  })
}

//查询所有启用的分类名称
export const checkCateGoriesReq = () => {
  return request({
    method: 'get',
    url: '/goods/categories',
  })
}

//商品图片上传接口
export const uploadGoodsImgReq = data => {
  return request({
    method: 'post',
    url: '/goods/goods_img_upload',
    data,
  })
}

//添加商品
export const addGoodsReq = data => {
  return request({
    method: 'post',
    url: '/goods/add',
    data,
  })
}

//获取商品列表
export const getGoodsListReq = params => {
  return request({
    method: 'get',
    url: '/goods/list',
    params,
  })
}

//删除商品
export const delGoodsReq = params => {
  return request({
    method: 'get',
    url: '/goods/del',
    params,
  })
}

//修改商品
export const editGoodsReq = data => {
  return request({
    method: 'post',
    url: '/goods/edit',
    data,
  })
}
